//
//  ViewController.swift
//  fishcare
//
//  Created by WS on 14/12/2017.
//  Copyright © 2017 wangsu. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    @IBOutlet weak var UsernameTextField: UITextField!
    @IBAction func EditingDidBegin(_ sender: Any) {
        //CGRect frame=UsernameTextField.frame;
        
    }
    //    -(void)textFieldDidBeginEditing:(UITextField *)textField{
//    CGRect frame = textField.frame;
//    int offset = frame.origin.y + 100 - (UISCREEN_HEIGHT - 480.0);//键盘高度
//    NSTimeInterval animationDuration = 0.30f;
//    [UIView beginAnimations:@"ResizeForKeyboard" context:nil];
//    [UIView setAnimationDuration:animationDuration];
//
//    //将视图的Y坐标向上移动offset个单位，以使下面腾出地方用于软键盘的显示
//    if(offset > 0)
//    self.view.frame = CGRectMake(0.0f, -offset, UISCREEN_WIDTH, UISCREEN_HEIGHT);
//    [UIView commitAnimations];
//    }
//
//    -(BOOL)textFieldShouldReturn:(UITextField *)textField {//按“完成”隐藏键盘
//    [textField resignFirstResponder];//隐藏输入键盘
//    return YES;
//    }
//
//    //输入框编辑完成以后，将视图恢复到原始状态
//    -(void)textFieldDidEndEditing:(UITextField *)textField{
//    self.view.frame = CGRectMake(0, 0, UISCREEN_WIDTH, UISCREEN_HEIGHT);
//    }

}

